﻿using MediatR;
using Product.Domain;
using Product.Infrstructre.Impl;
using Product.Read.API.Applcation.Command;

namespace Product.Read.API.Applcation.CommandHandlers
{
    public class ProductSetInfoCommandsHandlers : IRequestHandler<ProductSetInfoCommands, Products>
    {
        protected readonly IbaseProductInfoRepository _baseProductInfoRepository;

        public ProductSetInfoCommandsHandlers(IbaseProductInfoRepository baseProductInfoRepository)
        {
            _baseProductInfoRepository = baseProductInfoRepository;
        }

        public async Task<Products> Handle(ProductSetInfoCommands request, CancellationToken cancellationToken)
        {
            return await _baseProductInfoRepository.GetAllByIdAsync(request.id);

        }
    }
}
